package com.wkq.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Traveller {
    private String id;//主键id无意义
    private String name;//姓名
    private String sex;//性别
    private String phoneNum;//电话号码
    private Integer credentialsType;//身份证类型
    private String credentialsTypeStr;
    private String credentialsNum;//证件号码
    private Integer travellerType;//旅客类型
    private String travellerTypeStr;

    public String getTravellerTypeStr() {
        if (travellerType != null) {
//            0 成人 1 儿童
            if (travellerType == 0) {
                travellerTypeStr = "成人";
            }
            if (travellerType == 1) {
                travellerTypeStr = "儿童";
            }
        }
        return travellerTypeStr;
    }

    public String getCredentialsTypeStr() {
        if (credentialsType != null) {
//            0身份证 1护照 2军官证
            if (credentialsType == 0) {
                credentialsTypeStr = "身份证";
            }
            if (credentialsType == 1) {
                credentialsTypeStr = "护照";
            }
            if (credentialsType == 2) {
                credentialsTypeStr = "军官证";
            }
        }
        return credentialsTypeStr;
    }
}
